{php}
    $firstrun = input('param.firstrun/d', 0);
    $admin_1665976230_arr = cookie('admin-1665976230-arr');
    $admin_1665976230_arr = json_decode($admin_1665976230_arr);
    if (1 == $firstrun) {
        $admin_1665976230_arr = null;
    }
{/php}
<div class="sidebar-second order-navBox">
    <ul id="accordion" class="accordion">
        <li data-value="1" {if null === $admin_1665976230_arr || in_array(1, $admin_1665976230_arr)}class="open"{/if}>
            <a class="link">微信端<i class="fa fa-angle-right"></i></a>
            <ul class="submenu" {if is_array($admin_1665976230_arr) && !in_array(1, $admin_1665976230_arr)}style="display: none;"{/if}>
                <li>
                    <a {if condition="in_array($Request.action, ['weixin_conf'])"}class="current"{/if} href='{:url("Store/weixin_conf")}'>
                        微信小程序
                    </a>
                </li>
                <li>
                    <a {if condition="in_array($Request.action, ['wechat_conf'])"}class="current"{/if} href='{:url("Store/wechat_conf")}'>
                        微信公众号
                    </a>
                </li>
            </ul>
        </li>
        {empty name="$global['web_status']"}
        <li data-value="3" {if null === $admin_1665976230_arr || in_array(3, $admin_1665976230_arr)}class="open"{/if}>
            <a class="link">电脑端<i class="fa fa-angle-right"></i></a>
            <ul class="submenu" {if is_array($admin_1665976230_arr) && !in_array(3, $admin_1665976230_arr)}style="display: none;"{/if}>
                <li>
                    <a {if condition="in_array($Request.action, ['pc_conf'])"}class="current"{/if} href='{:url("Store/pc_conf")}'>
                        基础配置
                    </a>
                </li>
                <li>
                    <a {if condition="in_array($Request.action, ['index','add','edit']) && $Request.param.c == 'AdPosition'"}class="current"{/if} href='{:url("AdPosition/index",["position"=>1])}'>
                        广告配置
                    </a>
                </li>
                <li>
                    <a {if condition="in_array($Request.param.a, ['index']) && $Request.param.c == 'Navigation'"}class="current"{/if} href='{:url("Navigation/index",["position"=>1])}'>
                        导航配置
                    </a>
                </li>
                <li>
                    <a {if condition="in_array($Request.param.c, ['Seo','Sitemap','Links'])"}class="current"{/if} href='{:url("Seo/seo")}'>
                        SEO设置
                    </a>
                </li>
            </ul>
        </li>
        {/empty}
    </ul>
</div>

<script>
    $(function() {

        openClose();

        $('#accordion > li > a.link').click(function() {
            var $this = $(this);
                $parent = $this.parent();
                $next = $this.next();
            $next.slideToggle();
            $parent.toggleClass('open');
            openClose();
        });

        function openClose()
        {
            var arr = [];
            var className = '';
            $('#accordion > li').each(function(index, item){
                className = " " + $(item).attr('class') + " ";
                if (-1 < className.indexOf(' open ')) {
                    arr.push($(item).data('value'));
                }
            });
            arr = JSON.stringify(arr);
            setCookies('admin-1665976230-arr', arr);
        }
    });
</script>